package net.hn.hnms.biz.plan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.hn.hnms.biz.plan.domain.DispatchKeepWatchPerson;
import net.hn.hnms.biz.plan.vo.DispatchKeepWatchPersonVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DispatchKeepWatchPersonMapper extends BaseMapper<DispatchKeepWatchPerson> {


    @Select("<script>" +
            "   select keep_watch_person_post,post_type from dispatch_keep_watch_person group by keep_watch_person_post,post_type " +
            "</script>")
    List<DispatchKeepWatchPerson> selectPostType();


    @Select("<script>" +
            "   SELECT * FROM dispatch_keep_watch_person where post_type=#{type} and del_flag = '0' order by duty_order " +
            "</script>")
    List<DispatchKeepWatchPersonVO> selectWatchPerson(@Param("type") String type);

    @Select("<script>" +
            "   SELECT * FROM dispatch_keep_watch_person where keep_watch_person_name =#{name} and del_flag = '0'  " +
            "</script>")
    DispatchKeepWatchPersonVO selectWatchPersonByName(@Param("name") String name);

    @Select({
            "<script>",
            "SELECT * ",
            " FROM dispatch_keep_watch_person ",
            "  where del_flag = '0'  ",
            "</script>"
    })
    List<DispatchKeepWatchPersonVO> selectWatchPersonsByNames();
}
